<template>
	<view class="main">
		<view class="xc max-h" style="background-color: #FFF;">
      <view class="up">
<!--        <view class="title-xc" style="padding: 2px;">
          巡查计划详情
        </view>
        <div><u-line></u-line></div> -->

          <view class="content-xc" style="padding: 10px 10px 0px 10px;">
            <view class="c-xc-c" style="display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 10px;">
              <view class="cleft">
                项目名称
              </view>
              <view class="cright">
                {{data.xmmc}}
              </view>
            </view>
          </view>
          <view class="content-xc" style="padding: 10px 10px 0px 10px;">
            <view class="c-xc-c" style="display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 10px;">
              <view class="cleft">
                巡查时间
              </view>
              <view class="cright">
                {{data.jhkssj == data.jhjssj ? data.jhjssj : `${data.jhkssj}至${data.jhjssj}`}}
              </view>
            </view>
          </view>
          <view class="content-xc" style="padding: 10px 10px 0px 10px;">
            <view class="c-xc-c" style="display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 10px;">
              <view class="cleft">
                巡查内容
              </view>
              <view class="cright">
                {{data.jhnr}}
              </view>
            </view>
          </view>
          <view class="content-xc" style="padding: 10px 10px 0px 10px;">
            <view class="c-xc-c" style="display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 10px;">
              <view class="cleft">
                巡查人员
              </view>
              <view class="cright">
                {{data.xcry}}
              </view>
            </view>
          </view>
          <view class="content-xc" style="padding: 10px 10px 0px 10px;">
            <view class="c-xc-c" style="display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 10px;">
              <view class="cleft">
                巡查状态
              </view>
              <view class="cright">
                {{data.xczt == 0 ? '未巡查':'已巡查'}}
              </view>
            </view>
          </view>
          <view class="content-xc" style="padding: 10px 10px 0px 10px;">
            <view class="c-xc-c" style="display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 10px;">
              <view class="cleft">
                班次
              </view>
              <view class="cright">
                {{data.bc}}
              </view>
            </view>
          </view>
          <view class="content-xc" style="padding: 10px 10px 0px 10px;">
            <view class="c-xc-c" style="display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 10px;">
              <view class="cleft">
                项目片区
              </view>
              <view class="cright">
                {{data.xmpq}}
              </view>
            </view>
          </view>
          <view class="content-xc" style="padding: 10px 10px 0px 10px;">
            <view class="cleft">
              备注
            </view>
            <view class="cright">
              {{data.bz}}
            </view>
          </view>

      </view>
      <view class="bottom primary-btn" v-if="data.xczt == 0">
        	<u-button @click="jumpToXC()"
        		style="width: 60px;height: 30px;" text="巡 查"></u-button>
      </view>
    </view>
		</view>
	</view>
</template>

<script>
	import { findPro,getDateDic,getPagingFutureInfo } from '@/common/api.js'
  
	export default{
		onLoad: function(option){
			this.id = option.id
      this.planXmRelId = option.planXmRelId
			this.xmid = option.xmid
      this.xmmc = option.title
			// uni.setNavigationBarTitle({
			//     title: option.title
			// });
		},
		async onShow() {
			let that = this
      // await that.getPagingFutureInfo()
			that.getDic()
			// await that.getDetail(that.id)
		},
		data(){
			return{
				/* 字典 */
        xmmc: '',
				dic:{
					status:'Enabled',
					type:'PROJECT_ZGZT'
				},
        bcDict: {
          status:'Enabled',
          type:'XMXC_SHIFT'
        },
        bcList: [],
        pqDict: {
          status:'Enabled',
          type:'PROJECT_BMQX'
        },
        pqList: [],
        ztDict: {},
        
				dicList:[],
				data:'',
				list:[
					{name:'意见单编号',code:'yjbh',value:''},
					{name:'项目名称',code:'xmmc',value:''},
					{name:'整改状态',code:'zgztn',value:''},
					{name:'建设单位',code:'jsdw',value:''},
					{name:'监理单位',code:'jldw',value:''},
					{name:'施工单位',code:'sgdw',value:''},
					{name:'设计单位',code:'sjdw',value:''},
					{name:'责任部门',code:'trbm',value:''},
					{name:'项目进度情况',code:'xmjdms',value:''},
					{name:'指导单位',code:'zddw',value:''},
					{name:'指导人员',code:'zdry',value:''},
					{name:'指导时间',code:'zdsj',value:''},
					{name:'存在问题',code:'czwt',value:''},
					{name:'指导意见',code:'zdyj',value:''},
					{name:'整改要求',code:'zgyq',value:''},
					{name:'整改期限',code:'zgqx',value:''}
				],
				xcImageList:[],
				fkImageList:[],
				backTime:'',
				backContent:'',
				backStatus:'',
				sfzgwc:null,
				zgqxTxt:'',
				id:'',
        xmid: '',
        planXmRelId: ''
			}
		},
		methods:{
      getDic(){
        Promise.all([getDateDic(this.bcDict), getDateDic(this.pqDict)]).then(resArr => {

            getPagingFutureInfo({id: this.planXmRelId}).then(res=>{
              res.bc = resArr[0].find(item => item.code == res.bc).name
              res.xmpq = resArr[1].find(item => item.code == res.xmpq).name
              this.data = res
              
            }).catch(err => {
              console.log(err)
            })

        }).catch(err => {
          console.log(err)
        })
      },
      jumpToXC() {
        uni.navigateTo({
          url: `/pages/me/xcrz/index?id=${this.id}&xmid=${this.xmid}&xmmc=${this.xmmc}`
        })
      },
		}
	}
</script>

<style scoped>
  .max-h {
    height: 100vh;
    display: flex;
    flex-direction: column;
  }
  .up {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .bottom {
    display: flex;
    justify-content: center;
    padding-bottom: 50px;
  }
	.cleft{
		width: 100px;
		font-family: 'PingFangSC-Regular';
		font-size: 14px;
		color: #999999;
		font-weight: 400;
	}
	.cright{
		flex:1;
		font-family: 'PingFangSC-Regular';
		font-size: 14px;
		color: #212121;
		text-align: right;
		font-weight: 400;
	}
  .primary-btn /deep/ .u-button--info{
    width: 120px !important;
    color: white;
    background-color: rgb(255, 85, 0);
    border-color: rgb(255, 85, 0);
    border-width: 1px;
    border-style: solid;
  }
</style>